//package com.spring.config;
//
//import java.io.IOException;
//import java.lang.reflect.Type;
//import java.util.List;
//
//import javax.servlet.http.HttpServletRequest;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.MethodParameter;
//import org.springframework.http.converter.HttpMessageConverter;
//import org.springframework.http.converter.HttpMessageNotReadableException;
//import org.springframework.http.server.ServletServerHttpRequest;
//import org.springframework.util.Assert;
//import org.springframework.web.HttpMediaTypeNotSupportedException;
//import org.springframework.web.context.request.NativeWebRequest;
//import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor;
//
//@Configuration
//public class MyRequestResponseBodyMethodProcessor extends RequestResponseBodyMethodProcessor {
//
//	public MyRequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> converters) {
//		super(converters);
//	}
//
//	@Override
//	protected <T> Object readWithMessageConverters(NativeWebRequest webRequest, MethodParameter parameter,
//			Type paramType) throws IOException, HttpMediaTypeNotSupportedException, HttpMessageNotReadableException {
//		HttpServletRequest servletRequest = webRequest.getNativeRequest(HttpServletRequest.class);
//		Assert.state(servletRequest != null, "No HttpServletRequest");
//		ServletServerHttpRequest inputMessage = new ServletServerHttpRequest(servletRequest);
//
//		Object arg = readWithMessageConverters(inputMessage, parameter, paramType);
//		if (arg == null && checkRequired(parameter)) {
//			throw new HttpMessageNotReadableException("请求报文内容为空 " +
//					parameter.getExecutable().toGenericString(), inputMessage);
//		}
//		return arg;
//	}
//
//}
